<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml" lang="$if(lang)$$lang$$else$en-US$endif$" xml:lang="$if(lang)$$lang$$else$en-US$endif$">

<head>

<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta property="dc:format" content="text/html">
<meta name="generator" content="pandoc">
<meta name="viewport" content="wi/ th=device-width">
<meta property="dc:type" content="Text">
<meta property="dc:language" content="$if(lang)$$lang$$else$en$endif$">
<meta property="dc:title og:title" content="$pagetitle$">
$if(url)$<meta property="dc:identifier og:url" content="$url$">$endif$
<meta name="description" property="dc:description og:description schema:description" content="$if(description)$$description$$else$$pagetitle$$endif$">
$for(author-meta)$<meta name="author" content="$author-meta$">$endfor$
$if(date-meta)$<meta name="date" content="$date-meta$">$endif$
<meta name="keywords" property="dc:subject" content="$for(keywords-plain)$$keywords-plain$$sep$, $endfor$">

<title>$if(title-prefix)$$title-prefix$ - $endif$$pagetitle$</title>

<script>
window.PagedConfig = {
  before: async () => {
    // Expand the citations links
    let citations = document.querySelectorAll('.citation');
    for (let citation of citations) {
      let anchor = citation.querySelector('a');
      if (!anchor) continue;
      let span = document.createElement('span');
      span.innerHTML = anchor.innerHTML
      anchor.insertAdjacentElement('afterend', span)
      let href = anchor.getAttribute('href')
      anchor.remove();

      let newAnchor = document.createElement('a');
      newAnchor.setAttribute('href', href);
      citation.insertAdjacentElement('beforebegin', newAnchor);
      newAnchor.appendChild(citation);
    }

    // For the table captions, we would want to write this CSS rule:
    //     caption {caption-side: bottom-outside;}
    // However, the bottom-outside value is not standard and not implemented in Chrome.
    // So, we need to modify the DOM.
    let tables = document.querySelectorAll('table');
    for (let table of tables) {
      let caption = table.querySelector('caption');
      if (!caption) continue;
      let tableContainer = document.createElement('div');
      tableContainer.className = 'table-container';
      table.insertAdjacentElement('beforebegin', tableContainer);
      tableContainer.appendChild(table);
      let bookdownIdentifier = caption.querySelector('span[id^="tab\\:"]');
      if (!!bookdownIdentifier) {
        let tableId = bookdownIdentifier.id;
        bookdownIdentifier.removeAttribute('id');
        table.id = tableId;
      }
      let newCaption = document.createElement('p');
      newCaption.className = 'caption';
      newCaption.innerHTML = caption.innerHTML;
      caption.remove();
      tableContainer.appendChild(newCaption);
    }
  }
}
</script>

$if(math)$
$if(mathjax)$
<!-- dynamically load mathjax for compatibility with self-contained -->
<script>
(function() {
  let beforePaged = PagedConfig.before;

  window.PagedConfig = {
    before: async () => {
      await beforePaged();
      await new Promise((resolve, reject) => {
        var script = document.createElement("script");
        script.type = "text/javascript";
        var src = `$mathjaxurl$` + "?config=TeX-MML-AM_CHTML";
        if (location.protocol !== "file:" && /^https?:/.test(src))
          src = src.replace(/^https?:/, '');
        script.src = src;
        window.MathJax = {
          AuthorInit: () => {
            MathJax.Hub.Register.StartupHook("Begin", () => {
              MathJax.Hub.Queue(resolve);
            });
          }
        };
        document.getElementsByTagName("head")[0].appendChild(script);
      });
    }
  };
})();
</script>
$endif$
$endif$

$for(header-includes)$
$header-includes$
$endfor$

$if(highlightjs)$
<link rel="stylesheet"
      href="$highlightjs$/$if(highlightjs-theme)$$highlightjs-theme$$else$default$endif$.css"
      $if(html5)$$else$type="text/css" $endif$/>
<script src="$highlightjs$/highlight.js"></script>
<script type="text/javascript">
if (window.hljs && document.readyState && document.readyState === "complete") {
   window.setTimeout(function() {
      hljs.initHighlighting();
   }, 0);
}
</script>
$endif$

$if(highlighting-css)$
<style type="text/css">
$highlighting-css$
</style>
$endif$

$for(css)$
<link rel="stylesheet" href="$css$" $if(html5)$$else$type="text/css" $endif$/>
$endfor$

</head>

<body>
  <div style="display:none" aria-hidden="true">
  \(
    \let\pkg=\mathbf
    \let\proglang=\textsf
    \let\code=\texttt
    \newcommand{\E}{\mathsf{E}}
    \newcommand{\VAR}{\mathsf{VAR}}
    \newcommand{\COV}{\mathsf{COV}}
    \newcommand{\Prob}{\mathsf{P}}
  \)
  </div>

$for(include-before)$
$include-before$
$endfor$



<article>

$if(title)$
<header id="$idprefix$header" class="title-page">
<h1 class="title">$title$</h1>
<span class="shorttitle" style="display: none;" aria-hidden="true">$if(shorttitle)$$shorttitle$$else$$title$$endif$</span>
$if(author)$
<div class="authors-container" role="list">
$for(author)$
<p class="author-item" role="listitem" style="--rank: $author.rank$;">
$if(author.data.name)$
<span class="author">$author.data.name$</span>
$if(author.data.affiliation)$
<br><span class="author-affil">
$author.data.affiliation$
<br><span class="author-email"> <! –– email (+) -->
$author.data.email$
</span>
$endif$
$else$
<span class="author">$author.data$</span>
$endif$
</p>
$endfor$
</div>
$endif$
</header>
$endif$

<! –– add a date class to the front page (+)-->
<section class="date" property="dc:date">
$if(date)$
<h2 class="date">$date$</h2>
$endif$
</section>

<section class="abstract" property="dc:abstract">
$if(abstract)$
<h2 class="abstract-header">Abstract</h2>
<div class="abstract-content">
$abstract$
</div>
$endif$
<section class="keywords" role="list" aria-labelledby="$idprefix$keywords-header">
<p><span id="$idprefix$keywords-header" class="keywords-heading" aria-level="3" role="heading">Keywords</span>: $for(keywords)$<span role="listitem">$keywords$</span>$sep$, $endfor$.</p>
</section>
</section>


<main role="main">
$body$
</main>


</article>

$for(include-after)$
$include-after$
$endfor$

<script>
// when the page is about to reload via servr, remember the scroll position
document.addEventListener('servr:reload', function(e) {
  sessionStorage.setItem('pagedown-scroll', window.scrollY);
});
</script>
</body>
</html>
